<template>
	<view class="projectEmploy-container">
		<view class="">
			<view class="cu-bar search">
				<view class="search-form round">
					<text class="cuIcon-search"></text>
					<input @focus="InputFocus" @blur="InputBlur" :adjust-position="false" type="text" placeholder="搜索项目名称、关键词" confirm-type="search"></input>
				</view>
			</view>
		</view>
		<view class="tabSwitch">
			<scroll-view scroll-x class="nav" scroll-with-animation :scroll-left="scrollLeft">
				<view class="cu-item" :class="index==TabCur?'text-green cur':''" v-for="(item,index) in tabList" :key="index" @tap="tabSelect" :data-id="index">
					{{item.name}}
				</view>
			</scroll-view>
		</view>
		<view class="taskList">
			<view class="task-item" v-for="(item,index) in 6" :key="index" @tap="gotoDetail">
				<view class="item-top">
					<view class="item-title">项目名称</view>
					<!-- <view class="item-money">2000<span>元</span></view> -->
				</view>
				<view class="item-content">
					项目简介
				</view>
				<view class="tagsList">
					<view class="tags" v-for="item in tagList" :key="item.id">{{item.name}}</view>
				</view>
				<view class="publisher-container">
					<view class="publisher-avator">
						<view class="cu-avatar round" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg)"></view>
						<span>赵女士</span>
					</view>
					<view class="publisher-location">
						<text>截止2023.11.24</text>
					</view>
				</view>
			</view>
		</view>
		<!-- 发布信息按钮 -->
		<view class="sendBtn-contaienr" @tap="publishProject">
			<image
				src="/static/img/sendBtn.png"
				mode="scaleToFill"
			/>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				TabCur: 0,
				scrollLeft: 0,
				tagList:[
					{
						id:1,
						name:'本科'
					},
					{
						id:2,
						name:'硕士'
					},
					{
						id:3,
						name:'博士'
					},
				],
				tabList:[
					{
						id:1,
						name:'全部'
					},
					{
						id:2,
						name:'热门'
					},
					{
						id:3,
						name:'新发布'
					},
				]

			};
		},
		methods:{
			tabSelect(e) {
				this.TabCur = e.currentTarget.dataset.id;
				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
			},
			gotoDetail(){
				uni.navigateTo({
					url:'/subpackage/projectDetail/projectDetail'
				})
			},
			publishProject(){
				uni.navigateTo({
					url:'/subpackage/publishProject/publishProject'
				})
			}
			}
		}
</script>

<style lang="scss">
.sendBtn-contaienr{
	// 居中
	position: fixed;
	bottom: 0px;
	right: 123px;
	margin-right: 20rpx;
	margin-bottom: 20rpx;
	image{
		width: 200rpx;
		height: 200rpx;
	}
}
.taskList{
	background-color: #F8F8F8;
	padding: 9px;
	.task-item{
		background-color: #fff;
		margin-bottom: 18rpx;
		padding: 10px;
		border-radius: 10rpx;
		.publisher-container{
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 20rpx;
			.publisher-avator{
				display: flex;
				justify-content: flex-start;
				align-items: center;
				span{
					margin-left: 10rpx;
				}
			}
			.publisher-location{
				display: flex;
				justify-content: flex-end;
				align-items: center;
				text{
					font-size: 12px;
					color: #0074D6;
				}
			}
		}
		.item-top{
			display: flex;
			justify-content: space-between;
			align-items: center;
			
			.item-title{
				font-size: 16px;
				font-weight: bold;
			}
			.item-money{
				font-size: 16px;
				color: #0074D6;
				font-weight: bold;
				background-color: #fff;
				span{
					font-size: 12px;
					margin-left: 5rpx;
					font-weight: normal;
				}
			}
		}
		.item-content{
			margin-top: 20rpx;
			margin-bottom: 20rpx;
		}
		.tagsList{
			display: flex;
			justify-content: flex-start;
			align-items: center;
			font-size: 12px;
			.tags{
				color: #A8A8A8;
				background-color: #EDEDED;
				padding: 2px 5px;
				border-radius: 10rpx;
				margin-right: 10px;
			}
		}
	}
}
.tabSwitch{
	width: 100%;
	background-color: #fff;
	border-radius: 20rpx 20rpx 0 0 ;
	padding-top: 10rpx;
}
page {
	background-image: linear-gradient(#026aef 0, #fff 180px, #fff 200px, #f9f9f9 230px, #f9f9f9 100%);
	background-repeat: no-repeat;
	background-color: #f9f9f9;
}
</style>
